package com.xiyu.service.repository.mailbox.mail;

import com.xiyu.service.model.mailbox.mail.MailboxMailContent;
import com.xiyu.service.model.mailbox.mail.MailboxMailContentTable;
import org.babyfish.jimmer.spring.repository.JRepository;

public interface MailboxMailContentRepository extends JRepository<MailboxMailContent, Long> {
    MailboxMailContentTable mailboxMailContentTable = MailboxMailContentTable.$;

    default void updateContent(Long mailId, String content, String searchContent){
        sql().createUpdate(mailboxMailContentTable)
                .where(mailboxMailContentTable.mailId().eq(mailId))
                .set(mailboxMailContentTable.content(), content)
                .set(mailboxMailContentTable.searchContent(), searchContent)
                .execute();
    }


}